package com.tcxhb.job.core.utils;

import com.tcxhb.job.core.constants.enums.LogActionEnum;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description:
 * @Auther: tcxhb
 * @Date: 2023/11/21
 */
@Slf4j
public class LogUtils {

    public static void info(Long jobId, Long scheduleTime, LogActionEnum action, String msg) {
        String traceId = jobId + "-" + scheduleTime;
        info(traceId, action, msg);
    }

    public static void info(String traceId, LogActionEnum action, String msg) {
        StringBuilder builder = new StringBuilder();
        builder.append(traceId).append(",")
                .append(action.getCode()).append(",")
                .append(action.getName()).append(",")
                .append(msg);
        log.info(builder.toString());
    }

}
